package com.example.dao;

import com.example.entity.Classes;
import com.example.entity.Teacher;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface ClassesDao {
    @Select("select * from classes ")
    List<Classes> selectc();

    @Delete("delete from classes where classid=#{classid}")
    int delete(Integer classid);
@Select("select * from teacher where posts=1")
    List<Teacher> selectTByH();

    @Select("select * from teacher where posts=0")
    List<Teacher> selectTByT();

@Insert("insert into classes values(#{classid},#{classname},#{state},#{headmaster},#{teacher})")
    int addClass(Classes classes);
@Delete("delete from classes where classid=#{param1}")
    int del(Integer classid);
@Select("select * from classes where classid=#{param1}")
    Map<String, Object> selectByClassid(Integer classid);
@Update("update classes set classname=#{classname},state=#{state},headmaster=#{headmaster},teacher=#{teacher} where classid=#{classid}")
    int upd(Classes classes);
}
